SRCPATH = ./src
LIBPATH = ./lib
INCPATH = ./include
SRC = $(SRCPATH)/gui.c $(SRCPATH)/init.c $(SRCPATH)/playback.c $(SRCPATH)/main.c
LIBS = -lgfx -lfont -lX11 -lpulse-simple -lm


all: gfx
	gcc -I$(INCPATH) -L$(LIBPATH) -O3 -o coog $(SRC) $(LIBS)

gfx:
	gcc -I$(INCPATH) -O3 -c $(SRCPATH)/gfx.c -lX11 -lm -o gfx.o;
	ar -rcs $(LIBPATH)/libgfx.a gfx.o;
	rm gfx.o;
	gcc -I$(INCPATH) -L$(LIBPATH) -O3 -c $(SRCPATH)/font.c -lgfx -lX11 -lm -o font.o;
	ar -rcs $(LIBPATH)/libfont.a font.o;
	rm font.o;
	chmod +x $(LIBPATH)/*.a

clean-gfx:
	rm $(LIBPATH)/*.a

clean:
	rm coog
